package com.psmz.iwi.docanalyzer.core.document.parser;

import java.util.StringTokenizer;

public class TextExtractionResult {
	private String text;
	private long numberOfWords;

	public TextExtractionResult(String text) {
		this.text = text;
		numberOfWords = 0L;
		computeNumberOfWords(text);
	}

	private void computeNumberOfWords(String textValue) {
		StringTokenizer tokenizer = new StringTokenizer(textValue, " ");
		while (tokenizer.hasMoreElements()) {
			tokenizer.nextToken();
			numberOfWords++;
		}

	}

	public String getText() {
		return text;
	}

	public long getNumberOfWords() {
		return numberOfWords;
	}

}
